package com.sdkj.dspservice.modules.demand.api;

import com.sdkj.dspservice.common.base.controller.BaseController;
import com.sdkj.dspservice.common.react.AntdProResult;
import com.sdkj.dspservice.modules.demand.entity.Demand;
import com.sdkj.dspservice.modules.demand.service.DemandStatisticsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 需求统计Controller
 *
 * @author tm
 */
@RestController
@RequestMapping(value = "${project-config.apiUrl}/${project-config.version}/demand/statistics")
public class DemandStatisticsController extends BaseController {

    @Autowired
    private DemandStatisticsService demandStatisticsService;

    /**
     * 各类型数量统计
     *
     * @return
     */
    @RequestMapping(value = "type")
    public AntdProResult type(Demand demand) {
        return new AntdProResult().success(demandStatisticsService.statisticsByType(demand));
    }

//    /**
//     * 统计今年每月已完成的需求
//     *
//     * @return
//     */
//    @RequestMapping(value = "monthOfYear")
//    public AntdProResult monthOfYear() {
//        return new AntdProResult().success(demandStatisticsService.monthOfYear());
//    }

}
